<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>客户风险标记记录表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="rskCstSignLog_form">
    <%--<div class="fieldset1 tabel_col tabel_col_1 clearFix">

        <div class="fieldBox col_50">
            <div class="label">客户名称</div>
            <div class="field">
                <input name="cstNm" id="cstNm" type="text" class="ui-textbox" value="${cstBscInfoVO.cstNm}"
                       validate="{required:false,maxlength:60}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">合同号</div>
            <div class="field">
                <input name="lsCntNo" id="lsCntNo" type="text" class="ui-textbox" value="${prjBscInfoVO.lsCntNo}"
                       validate="{required:false,maxlength:30}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">设备数量</div>
            <div class="field">
                <input name="prdCount" id="prdCount" type="text" class="ui-textbox" value="${prdCount}"
                       validate="{required:false,maxlength:30}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">项目类型</div>
            <div class="field">
                <c:forEach items="${prjTypeList}" var="prjType">
                    <c:if test="${prjType.key == prjBscInfoVO.prjTypCd}">
                        <input name="prjType" id="prjType" type="text" class="ui-textbox" value="${prjType.value}"
                               validate="{required:false,maxlength:30}" readonly="readonly">
                    </c:if>
                </c:forEach>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">事业部</div>
            <div class="field">
                <c:forEach items="${buOrgList}" var="buOrg">
                    <c:if test="${buOrg.key == prjBscInfoVO.buOrgCd}">
                        <input name="buOrg" id="buOrg" type="text" class="ui-textbox" value="${buOrg.value}"
                               validate="{required:false,maxlength:30}" readonly="readonly">
                    </c:if>
                </c:forEach>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">融资额</div>
            <div class="field">
                <input name="financingAmt" id="financingAmt" type="text" class="ui-textbox" value="${actLsAmt}"
                       validate="{required:false,maxlength:30}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">当前敞口</div>
            <div class="field">
                <input name="open" id="open" type="text" class="ui-textbox" value="${open}"
                       validate="{required:false,maxlength:30}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">最早起租日期</div>
            <div class="field">
                <input name="earliestRtDt" id="earliestRtDt" type="text" class="ui-textbox" value="${earlistRtDt}"
                       validate="{maxlength:30}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">标记原因&lt;%&ndash; 1.顶名购买 2.团单拆单 3.老赖 4.诈骗 5.法律纠纷 6.他人运营 7.私下转账 8.代收代付&ndash;%&gt;</div>
            <div class="field">
                <input name="signResCd" id="signResCd" placeholder="请选择" ltype="combobox" validate="{required:true}">
                &lt;%&ndash;<select name="signResCd" id="signResCd" data-value=""
                        validate="{required:true}">
                    <option value="" selected>请选择</option>
                    <c:forEach items="${signResCdList}" var="item">
                        <option value="${item.key }">${item.value }</option>
                    </c:forEach>
                </select>&ndash;%&gt;
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">标记时间</div>
            <div class="field">
                <input name="crtTm" id="crtTm" type="text" class="ui-textbox" value="${crtTm}"
                       validate="{required:false,maxlength:30}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">标记人</div>
            <div class="field">
                <input name="crtUsrNm" id="crtUsrNm" type="text" class="ui-textbox" value="${currentUserName}"
                       validate="{required:true,maxlength:30}" readonly="readonly">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">

        </div>
        <div class="fieldBox col_50">
            <div class="label">备注</div>
            <div class="field">
                <textarea name="signRem" id="signRem" type="text" class="ui-textbox" cols="50" rows="6"
                          value=""
                          validate="{required:false,maxlength:255}">${rskCstSignLogVO.signRem}</textarea>
                &lt;%&ndash;<input name="signRem" id="signRem" type="text" class="ui-textbox" value="${rskCstSignLogVO.signRem}"
                       validate="{maxlength:255}" style="height:30px; width:50px">&ndash;%&gt;
                &lt;%&ndash;<span class="requiredSymbol">*</span>&ndash;%&gt;
            </div>
        </div>
    </div>
--%>
    <div class="fieldset1 tabel_col noBorder clearFix">
        <div class="fieldBox col_50">
            <div class="label">客户名称</div>
            <div class="field">
                ${cstBscInfoVO.cstNm}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">合同号</div>
            <div class="field">
                ${prjBscInfoVO.lsCntNo}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">设备数量</div>
            <div class="field">
                ${prdCount}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">项目类型</div>
            <div class="field">
                <c:forEach items="${prjTypeList}" var="prjType">
                    <c:if test="${prjType.key == prjBscInfoVO.prjTypCd}">
                        ${prjType.value}
                    </c:if>
                </c:forEach>
            </div>
        </div>

        <div class="fieldBox col_50">
            <div class="label">事业部</div>
            <div class="field">
                <c:forEach items="${buOrgList}" var="buOrg">
                    <c:if test="${buOrg.key == prjBscInfoVO.buOrgCd}">
                        ${buOrg.value}
                    </c:if>
                </c:forEach>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">融资额</div>
            <div class="field">
                <span id="actLsAmt"></span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">当前敞口</div>
            <div class="field">
                <span id="open"></span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">最早起租日期</div>
            <div class="field">
                ${earlistRtDt}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">标记类型</div>
            <div class="field">
                ${rskCstSignLogVO.signResTypeNm}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">标记原因</div>
            <div class="field">
                <span id="signResCd"></span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">标记时间</div>
            <div class="field">
                ${crtTm}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">标记人</div>
            <div class="field">
                ${rskCstSignLogVO.crtUsrNm}
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">备注</div>
            <div class="field">
                ${rskCstSignLogVO.signRem}
            </div>
        </div>
    </div>
    <%--<input type="hidden" id="test" value="${signResCdListJson}">--%>
</form>
<script>
    function formatNumber(str) {
        return str.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
    }

    // 获取字符串的字节长度
    function getByteLen(str) {
        var len = 0;
        for (var i = 0; i < str.length; i++) {
            var a = str.charAt(i);
            if (a.match(/[^\x00-\xff]/ig) != null) {
                len += 2;
            } else {
                len += 1;
            }
        }
        return len;
    }

    $(function () {
        // 判断是查看还是修改
        var flag = "${flag}";
        // 当前风险标记原因
        var signRes = "${rskCstSignLogVO.signResCd}";

        // 查看详情
        var signResCd = $("#signResCd");
        $("#signRem").attr("disabled", true);
        $.each(${signResCdListJson}, function (i, o) {
            if (signRes == o.key) {
                $("#signResCd").text(o.value);
            }
        });

        // 设置融资额
        var actLsAmt = "${actLsAmt}";
        var actLsAmtDiv = $("#actLsAmt");
        var financingAmtValue = parseInt(actLsAmt) / 100;
        actLsAmtDiv.text("￥" + formatNumber(financingAmtValue.toString()));
        // 设置敞口
        var openText = $("#open");
        var openValue = parseInt("${open}") / 100;
        openText.text("￥" + formatNumber(openValue.toString()));

        var rskCstSignLogId = "${rskCstSignLogVO.id}";//主键ID
        var cstId = "${cstBscInfoVO.id}"; // 客户ID
        var prjId = "${prjBscInfoVO.id}"; // 项目ID
        $("#rskCstSignLog_form").ligerForm({
            validate: true
        });

    });
</script>
</body>
</html>
